/// @tags:
#include <algorithm>
#include <cctype>
#include <cstdio>

namespace BlueQuantum {

int const N = 1e3 + 5;

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

int n, tot, L, R;
int h[N], a[N * N];

inline int main() {
  read(n);
  for (int i = 1; i <= n; ++i) read(h[i]);
  read(L), read(R);
  for (int l = 1; l <= n; ++l) {
    int min = 0x3f3f3f3f;
    for (int r = l; r <= n; ++r) {
      min = std ::min(min, h[r]);
      a[++tot] = min * (r - l + 1);
    }
  }
  std::sort(a + 1, a + tot + 1);
  for (int i = L; i <= R; ++i) printf("%d ", a[i]);
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("矩形.in", "r", stdin);
  freopen("矩形.out", "w", stdout);
#endif
#endif

  return BlueQuantum::main();
}